<template>
	<div class="wraper shown" :class="{padTop:isIphoneX,iphone:isIphone}">
		<div class="line"></div>
		<div class="nav-bar">
			<div class="arrow" @click="goBack"></div>
			<span @click="$router.push('/redhistory')">{{$t('redetails-key1')}}</span>
		</div>
		<div class="content" v-if="list.length">
			<h1 v-if="url"><img :src="url+'?imageView2/1/w/100/h/100'" alt=""></h1>
			<h1 v-else><img src="../../static/images/redpacket/default_avatar.png" alt=""></h1>
			<h2>“<span class="one-line">{{name}}</span>”{{packetType}}</h2>
			<h4 v-if="errMsg" :class="{s:user_amount<=0}">{{errMsg}}</h4>
			<h3 v-if="user_amount">{{typeof user_amount === 'number'?user_amount.toFixed(8):user_amount}}<span>{{currency_id}}</span></h3>
		</div>
		<dl v-if="list.length">
			<dt>
				<span v-if="total===get_nums"> {{$t('redetails-key2',{total:total,shownSecond:shownSecond})}}</span>
				<span v-else>{{$t('redetails-key3',{get_nums:get_nums,total:total})}}</span>
			</dt>
			<dd v-for="item in list">
				<img class="header" v-if="item.url" :src="item.url+'?imageView2/1/w/100/h/100'" alt="">
				<img class="header" v-else src="../../static/images/redpacket/default_avatar.png">
				<ul>
					<div class="left">
						<p class="name one-line">{{item.name}}</p>
						<p class="time">{{item.time}}</p>
					</div>
					<div class="right">
						<p class="money">{{Number(item.amt).toFixed(8)}} <span>{{currency_id}}</span></p>
						<p class="best" v-if="item.is_best"><img src="../../static/images/redpacket/red_open_champion.png" alt="">{{$t('redetails-key4')}}</p>
					</div>
				</ul>
			</dd>
		</dl>
	</div>
</template>
<script src="./redDetails.js"></script>
<style scoped lang="scss">
	@import './redDetails.scss';
</style>